<script type="text/javascript">
$.CurrentNavtab.find('#user-datagrid').datagrid({
    gridTitle : '提示：1）用户初始密码6个6；2）删除用户进入到回收站中，未真正删除；3）用户登录名唯一',
    showToolbar: true,
    toolbarItem: "add,|,refresh",
    local: 'remote',
    dataUrl: 'sys/user/findByPage',
    dataType: 'json',
    sortAll:true,
    filterAll:true,
    showCheckboxcol:true,
    columns: [
        {
            name: 'userCode',
            label: '用户登录名',
            align: 'left',
            edit:false,
            rule: 'required',
            width: 60
        },
        {
            name: 'userName',
            label: '用户姓名',
            align: 'left',
            width: 60
        },
        {
            name: 'idCard',
            label: '身份标识码',
            align: 'left',
            width: 200
        },
        {
            name: 'email',
            label: '邮箱',
            align: 'left',
            width: 160
        },
        {
            name: 'lastLoginTime',
            label: '最后一次登录时间',
            align: 'center',
            edit:false,
            add:false,
            type: 'date',
            pattern: 'yyyy-MM-dd HH:mm:ss',
            width: 65
        },
        {
            name: 'online',
            label: '是否在线',
            align: 'center',
            type:'select',
            items:[{'1':'在线'},{'0':'离线'}],
            width: 35,
            edit:false,
            add:false,
            render: function(value) {
                switch(value){
                case 1:return '<i class="fa fa-user" style="color:red"></i>';
                default:return '<i class="fa fa-user" style="color:gray"></i>';;
                }
            }
        },
        {
            name: 'status',
            label: '状态',
            align: 'center',
            type:'select',
            items:[{'1':'正常'},{'-1':'注销'},{'2':'锁定'}],
            edit:false,
            add:false,
            width: 40,
            render: function(value) {
               switch(value){
               case 1:return '正常';
               case 2:return '<span style="color:red">锁定</span>';
               case 0:return '未激活';
               case -1:return '<span style="color:gray">注销</span>';
               default:return '未知';
               }
            }
        }
    ],
    hiddenFields:["id"],
    editUrl: 'sys/user/userInfoMgr?action=save',
    delUrl:'sys/user/userInfoMgr?action=del',
    paging: {pageSize:20, pageCurrent:1},
    showEditbtnscol: true,
    linenumberAll: true,
    fullGrid:true
});
</script>

<div class="bjui-pageContent  tableContent">
     <table id="user-datagrid" data-width="100%" data-height="100%" class="table table-bordered">
     </table>
</div>